
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
        xmlns:h="http://java.sun.com/jsf/html"
        xmlns:f="http://java.sun.com/jsf/core"
        xmlns:p="http://primefaces.org/ui"
        xmlns:ui="http://java.sun.com/jsf/facelets">

<h:head>
        <title>Admin Panel</title>
</h:head>
<h:body style="background:#2A2D30">
<br></br>
 <p:panel  style="margin-bottom:10px;" >
   <h:form>
       <p:growl  id="msgs" showDetail="true"/>
    <p:breadCrumb>  
    <p:menuitem  value="Profile" url="home.xhtml?admin=true" /> 
    <p:menuitem value="Profile " url="profile.xhtml" />  
    <p:menuitem value="E-mail" url="#" />  
    </p:breadCrumb> 
    </h:form>
    </p:panel>

<h:form>
         <p:panel  style="height:500px">
         <br></br>
         <br></br>
                                 <h:panelGrid columns="3" id="add_standardpkGrid">
                                <h:outputLabel for="sCity">City:</h:outputLabel>
                                <p:inputText id="sCity" value="#{standardpkbean.standardpkdto.sCity}" />
                                <p:message for="sCity" />

                                <h:outputLabel for="sNofdays">Number of days:</h:outputLabel>
                                <p:inputText id="sNofdays"
                                        value="#{standardpkbean.standardpkdto.sNofdays}" />
                                <p:message for="sNofdays" />

                                <h:outputLabel for="sHotel">Hotel:</h:outputLabel>
                                <p:inputText id="sHotel" value="#{standardpkbean.standardpkdto.sHotel}" />
                                <p:message for="sHotel" />
                                
                                <h:outputLabel for="sFlight">Flight:</h:outputLabel>
                                <p:inputText id="sFlight" value="#{standardpkbean.standardpkdto.sFlight}" />
                                <p:message for="sFlight" />
                                
                                   
                                <h:outputLabel for="sExcursion">Excursion:</h:outputLabel>
                                <p:inputText id="sExcursion" value="#{standardpkbean.standardpkdto.sExcursion}" />
                                <p:message for="sExcursion" />

                            

                                <h:outputLabel for="sPrice">Price:</h:outputLabel>
                                <p:inputText id="sPrice" value="#{standardpkbean.standardpkdto.sPrice}">
                                        <p:ajax update="addstandardpk" />
                                </p:inputText>
                                <p:message for="sPrice" />

<br></br>
<br></br>

                        </h:panelGrid>
                        <p:commandButton id="addstandardpk" value="Add Standard Package"
                                update="add_standardpkGrid,successDlg" title="Complete"
                                action="#{standardpkbean.register()}"
                                oncomplete="PF('successDialog').show()" />
             
               </p:panel>
               
                <p:dialog header="Status" widgetVar="successDialog" resizable="false"
                        id="successDlg" showEffect="fade" hideEffect="drop" modal="true"
                        draggable="no">

                        <h:outputText rendered="#{(empty standardpkbean.standardpkdto.sCity)}"
                                value="Error!No data added" />

                        <p:panel rendered="#{(not empty standardpkbean.standardpkdto.sCity)}">
                                <h:panelGrid columns="3">
                                        <h:outputText value="The Standard package for City: '"></h:outputText>
                                        <h:outputText value="#{(standardpkbean.standardpkdto.sCity)}" />
                                        <h:outputText value="' is  added successfully" />
                                </h:panelGrid>
                        </p:panel>
                        <h:form>
                                <br />
                                <p:button value="Add Another Standard Package"
                                        outcome="standardpk.xhtml" />
                                <p:button value="back" outcome="index.xhtml" />
                       
                        </h:form>
                </p:dialog>
                <br></br>
        <p:panel>
      <p:button value="back" outcome="index.xhtml" />
      </p:panel>

        </h:form>
</h:body>
</html>